package com.mingqi.enetconnected.primary.mytask.activity;

import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.mingqi.enetconnected.R;
import com.mingqi.enetconnected.base.BaseActivity;
import com.mingqi.enetconnected.primary.mytask.event.PutTableEvent;
import com.mingqi.enetconnected.view.MultipleTextSwitch;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.OnClick;

public class PutTableActivity extends BaseActivity {

    @BindView(R.id.tv_save)
    TextView mTvSave;
    @BindView(R.id.et_table_num)
    EditText mEtTableNum;
    @BindView(R.id.tv_model_num)
    TextView mTvModelNum;
    @BindView(R.id.tv_management_mode)
    TextView mTvManagementMode;
    @BindView(R.id.tv_table_location)
    TextView mTvTableLocation;
    @BindView(R.id.mts_table_direction)
    MultipleTextSwitch mMtsTableDirection;
    @BindView(R.id.mts_install_direction)
    MultipleTextSwitch mMtsInstallDirection;
    @BindView(R.id.tv_start_date)
    TextView mTvStartDate;
    @BindView(R.id.tv_finish_date)
    TextView mTvFinishDate;
    @BindView(R.id.et_bar_code)
    EditText mEtBarCode;
    @BindView(R.id.et_safety_card)
    EditText mEtSafetyCard;
    @BindView(R.id.tv_process_type)
    TextView mTvProcessType;
    @BindView(R.id.tv_table_quality)
    TextView mTvTableQuality;
    @BindView(R.id.mts_buy)
    MultipleTextSwitch mMtsBuy;
    @BindView(R.id.mts_charge)
    MultipleTextSwitch mMtsCharge;

    @Override
    protected int getLayoutID() {
        return R.layout.activity_put_table;
    }

    @Override
    protected void initView() {


        setTitleName(R.string.put_table);
    }

    @Override
    protected void initClick() {

    }


    @OnClick({R.id.tv_model_num, R.id.tv_management_mode, R.id.tv_table_location, R.id.tv_process_type, R.id.tv_table_quality, R.id.tv_save})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_model_num:

                startActivity(ChooseParamsActivity.class);
                break;
            case R.id.tv_management_mode:
                break;
            case R.id.tv_table_location:
                break;
            case R.id.tv_process_type:
                break;
            case R.id.tv_table_quality:
                break;
            case R.id.tv_save:

                saveTableAttr();
                break;
        }
    }

    private void saveTableAttr() {

        finish();
        EventBus.getDefault().post(new PutTableEvent(true));
    }
}
